dojo.provide("mydojo.ValidationTextBox");
dojo.require("dojox.grid._data.editors");
dojo.require("dijit.Editor");
dojo.require("dijit.form.ValidationTextBox");
//[dojox.grid.editors.AlwaysOn,dojox.grid.editors.Dijit]don,t work
dojo.declare("mydojo.ValidationTextBox",dojox.grid.editors.Dijit, {
    editorClass: "dijit.form.ValidationTextBox",
    //alwaysOn:true,
	/*setValue: function(inRowIndex, inValue){
			//this.inherited('setValue', arguments);
			//this.validate(false);
			if(this.editor){
			this.editor.setValue(inValue);
		}else{
			this.inherited(arguments);
		} },
	*/
	getEditorProps: function(inDatum){
	
	  return dojo.mixin({}, this.cell.editorProps||{}, {
	    constraints: dojo.mixin({}, this.cell.constraint) || {},
	 		value: inDatum,
			required: this.cell.required,
			//regExp: this.cell.regExp,
			invalidMessage:this.cell.invalidMessage,
			maxLength:this.cell.maxLength
			
		});
  }
  /*,
  _formatNode: function(inDatum, inRowIndex){

		this.formatNode(this.getNode(inRowIndex), inDatum, inRowIndex);
	},
	
	formatNode: function(inNode, inDatum, inRowIndex){
	 if(!this.editorClass){
			return inDatum;
		}
		if(!this.editor){
			this.editor = this.createEditor.apply(this, arguments);
		}else{
			this.attachEditor.apply(this, arguments);
		}
		this.sizeEditor.apply(this, arguments);
		this.cell.grid.rowHeightChanged(inRowIndex);
		if(dojo.isIE){
			// IE sux bad
			dojox.grid.whenIdle(this, "focus", inRowIndex, inNode);
		}else{
			this.focus(inRowIndex, inNode);
		}
		// FIXME: feels too specific for this interface
		this.cell.registerOnBlur(inNode, inRowIndex);
	},
	applyStaticValue: function(inRowIndex){

		var e = this.cell.grid.edit;
		e.applyCellEdit(this.getValue(inRowIndex), this.cell, inRowIndex);
		e.start(this.cell, inRowIndex, true);
	},
	_finish: function(inRowIndex){

		this.inherited(arguments);
		var n = this.getNode(inRowIndex);
		try{
			dojox.grid.fire(n, "blur");
		}catch(e){}
	}*/
  });

